﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="GiaiquyetthutuchanhchinhEdit.ascx.cs"
    Inherits="VDC.VONE.WEB.Modules.HoSo.Controls.GiaiquyetthutuchanhchinhEdit" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Import Namespace="VDC.COMMON" %>
<style>
    .fixCss {
        margin-left: -4px;
    }

    @-moz-document url-prefix() {
        .fixCss;

    {
        margin-left: 0px;
    }

    }
</style>
<!--[if IE 7]>
    <style type="text/css">
        .fixCss {
            margin-left: 0px;
        }
    </style>
<![endif]-->
<!--[if IE 8]>
    <style type="text/css">
        .fixCss {
            margin-left: 0px;
        }
    </style>
<![endif]-->
<!--[if IE 9]>
    <style type="text/css">
        .fixCss {
            margin-left: -4px;
        }
        .default {
        }
    </style>
<![endif]-->
<script src='<%= this.ResolveUrl("~/Scripts/jquery.MultiFile.pack.js") %>' type="text/javascript"></script>
<table class="tbl_data wrapText" width="97%" cellspacing="0" cellpadding="0" align="center">
    <tr>
        <th align="left" valign="middle" style="border-right: 0px; padding-left: 8px" class="tab_selected">
            <img width="24" height="26" align="absmiddle" style="padding-right: 8px;" alt=""
                src='<%=this.ResolveUrl("~/Images/note.png") %>'>
            <asp:Label runat="server" ID="lblHeader" Text="TIẾP NHẬN HỒ SƠ" />
        </th>
    </tr>
    <tr>
        <td align="left">
            <table cellpadding="0" cellspacing="1" width="98%" style="margin: 8px;">
                <tr>
                    <td align="left" colspan="2">
                        <ul class="ac_list">
                            <li class="li_sel">
                                <asp:LinkButton runat="server" ID="lbtThongtinchung" Text="Thông tin chung" TabIndex="1" OnClick="LbtThongtinchungClick"></asp:LinkButton></li>
                            <li>
                                <asp:LinkButton runat="server" ID="lbtTiendo" Text="Tiến độ" OnClick="LbtTiendoClick" TabIndex="2"
                                    Enabled="True"></asp:LinkButton></li>
                            <li>
                                <asp:LinkButton runat="server" ID="lbtTailieu" Text="Tài liệu" OnClick="LbtTailieuClick" TabIndex="3"
                                    Enabled="True"></asp:LinkButton></li>
                            <li>
                                <asp:LinkButton runat="server" ID="lbtYkien" Text="Ý kiến" OnClick="LbtYkienClick" TabIndex="4"
                                    Enabled="True"></asp:LinkButton></li>
                            <li>
                                <asp:LinkButton runat="server" ID="lbtCongviec" Text="Công việc" OnClick="LbtCongviecClick" TabIndex="5"
                                    Enabled="True"></asp:LinkButton></li>
                            <li>
                                <asp:LinkButton runat="server" ID="lbtXemdon" Text="Xem đơn" OnClick="LbtXemdonClick" TabIndex="6"></asp:LinkButton></li>
                            <li>
                                <asp:LinkButton runat="server" ID="lbtQuatrinh" Text="Quá trình" OnClick="LbtQuatrinhClick" TabIndex="7"
                                    Enabled="True"></asp:LinkButton></li>
                            <li>
                                <asp:LinkButton runat="server" ID="lbtChuyenxuly" Text="Chuyển xử lý" OnClick="LbtChuyenxulyClick" TabIndex="8"
                                    Enabled="True" Visible="False"></asp:LinkButton></li>
                        </ul>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:Label runat="server" ID="lblNotFile" ForeColor="Red" Font-Bold="True"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="css_gchu">Mã thủ tục&nbsp;
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txtProfileTypeCode" CssClass="css_ma"
                            MaxLength="50" TabIndex="9"></asp:TextBox>
                        <asp:Button ID="btnProfileTypeSelect" CausesValidation="False" CssClass="css_button" runat="server"
                            OnClick="BtnProfileTypeSelect_OnClick" Text="Chọn thủ tục" TabIndex="10"/>
                    </td>
                </tr>
                <tr>
                    <td class="css_gchu">Thủ tục
                    </td>
                    <td style="width: 77%">
                        <asp:Label runat="server" ID="lblProfileType" style="word-wrap: normal; word-break: break-all;"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="css_gchu"><%--thủ tục <span class="emphas">*</span>--%>
                    </td>
                    <td>
                        <div style="width:552px;overflow:hidden;"> 
                        <asp:DropDownList runat="server" Width="552px" ID="ddlProfileType" CssClass="css_drop fixed-select-no-css"
                            AutoPostBack="True" OnSelectedIndexChanged="DdlProfileTypeSelectedIndexChanged"
                            CausesValidation="False" TabIndex="11" Visible="False">
                            <Items>
                                <asp:ListItem Text="---Chọn thủ tục---" Value="0"></asp:ListItem>
                                <asp:ListItem Text="Loại 1" Value="1"></asp:ListItem>
                                <asp:ListItem Text="Loại 2" Value="2"></asp:ListItem>
                                <asp:ListItem Text="Loại 3" Value="3"></asp:ListItem>
                                <asp:ListItem Text="Loại 4" Value="4"></asp:ListItem>
                                <asp:ListItem Text="Loại 5" Value="5"></asp:ListItem>
                            </Items>
                        </asp:DropDownList>
                        <br />
                        <asp:RequiredFieldValidator ID="rfddlProfileType" runat="server" Text="Chọn thủ tục"
                            InitialValue="0" ControlToValidate="ddlProfileType" ValidationGroup="btok" Display="Dynamic"
                            ForeColor="Red" SetFocusOnError="True" />
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="css_gchu">Trạng thái hồ sơ
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txtProfileStatus" CssClass="css_ma" Enabled="False"
                            Text="BATDAU"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" class="C_out">
                        <%--<table cellpadding="0" cellspacing="1" width="100%" class="C_in">
                            <tr>
                                <td colspan="2">
                                    <h3 class="C_in_title">Yêu cầu thực hiện thủ tục hành chính</h3>
                                </td>
                            </tr>
                        </table>--%>
                        <div class="collapsibleContainer" alt='<table cellpadding="0" cellspacing="1" width="100%" class="C_in">
                                <tr>
                                    <td colspan="2">
                                        <h3 class="C_in_title">Yêu cầu thực hiện thủ tục hành chính</h3>
                                    </td>
                                </tr>
                            </table>'>
                            <p>
                                <asp:ListView ID="lstRequirement" runat="server">
                                    <ItemTemplate>
                                        <p class="lbl">
                                            -
                                <%# TemplateControl.EvalEncode("Name") %>
                                        </p>
                                    </ItemTemplate>
                                </asp:ListView>
                            </p>
                        </div>
                    </td>
                </tr>
                <%--<asp:ListView ID="lstRequirement" runat="server">
                    <ItemTemplate>
                        <tr>
                            <td class="lbl" colspan="2">-
                                <%# TemplateControl.EvalEncode("Name") %>
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:ListView>--%>
                <tr>
                    <td colspan="2" class="C_out">
                        <%--<table cellpadding="0" cellspacing="1" width="100%" class="C_in">
                            <tr>
                                <td colspan="2">
                                    <h3 class="C_in_title">Căn cứ pháp lý thủ tục hành chính</h3>
                                </td>
                            </tr>
                        </table>
                        --%>
                        <div class="collapsibleContainer" alt='<table cellpadding="0" cellspacing="1" width="100%" class="C_in">
                                <tr>
                                    <td colspan="2">
                                        <h3 class="C_in_title">Căn cứ pháp lý thủ tục hành chính</h3>
                                    </td>
                                </tr>
                            </table>'>
                            <p>
                                <asp:ListView ID="lstLegalGround" runat="server">
                                    <ItemTemplate>
                                        <p class="lbl">
                                            -
                                <%# TemplateControl.EvalEncode("Name") %>
                                        </p>
                                    </ItemTemplate>
                                </asp:ListView>
                            </p>
                        </div>

                    </td>
                </tr>
                <%--<asp:ListView ID="lstLegalGround" runat="server">
                    <ItemTemplate>
                        <tr>
                            <td class="lbl" colspan="2">-
                                <%# TemplateControl.EvalEncode("Name") %>
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:ListView>--%>
                <tr>
                    <td colspan="2" class="C_out">
                        <table cellpadding="0" cellspacing="1" width="100%" class="C_in">
                            <tr>
                                <td colspan="2">
                                    <h3 class="C_in_title">Thành phần hồ sơ</h3>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td class="lbl" colspan="2">
                        <asp:CheckBoxList runat="server" ID="lstComposition" TabIndex="12" />
                    </td>
                </tr>
                <tr>
                    <td class="css_gchu">Số lượng hồ sơ
                    </td>
                    <td>
                        <asp:Label runat="server" ID="lblProfileAmount" Text=""></asp:Label>
                        <asp:Label runat="server" ID="lblBo" Text="(bộ)" Visible="False" />
                    </td>
                </tr>
                <tr>
                    <td class="css_gchu">Thời gian giải quyết
                    </td>
                    <td>
                        <asp:Label ID="lblNoGT" runat="server" Text="Không quá" Visible="False" />
                        <asp:Label ID="lblResolveDays" runat="server" Text="" />
                        <asp:Label runat="server" ID="lblDates" Text="ngày kể từ khi nhận đủ hồ sơ hợp lệ"
                            Visible="False"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="css_gchu">Phí
                    </td>
                    <td>
                        <asp:Label runat="server" ID="lblFees" Text=""></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" class="C_out">
                        <table cellpadding="0" cellspacing="1" width="100%" class="C_in">
                            <tr>
                                <td colspan="2">
                                    <h3 class="C_in_title">Thông tin hồ sơ</h3>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td class="css_gchu">Mã hồ sơ <span class="emphas">*</span>
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txtCode" Enabled="False" Text="MHS1" CssClass="css_ma"
                            MaxLength="50"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="css_gchu">Tên hồ sơ <span class="emphas">*</span>
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txtName" Text="" CssClass="css_ma" Width="552px"
                            MaxLength="256" TabIndex="13"></asp:TextBox>
                        <br />
                        <asp:RequiredFieldValidator ID="rftxtName" runat="server" ControlToValidate="txtName"
                            Text="Tên hồ sơ không để trống" SetFocusOnError="True" Display="Dynamic" ForeColor="Red"
                            ValidationGroup="btok" />
                    </td>
                </tr>
                <tr>
                    <td class="css_gchu">Số điện thoại nhận SMS
                    </td>
                    <td align="left">
                        <table cellpadding="0" cellspacing="0">
                            <tr>
                                <td>
                                    <asp:TextBox runat="server" ID="txtSms" CssClass="css_ma" Width="100px" TabIndex="14"></asp:TextBox>
                                    <br />
                                    <asp:RegularExpressionValidator ID="retxtSms" runat="server" ForeColor="Red"
                                        ErrorMessage="Số SMS không hợp lệ." ControlToValidate="txtSms" Display="Dynamic"
                                        SetFocusOnError="True"
                                        ValidationExpression="^(0\d{9,10})$" ValidationGroup="btok"></asp:RegularExpressionValidator>
                                </td>
                                <td class="css_gchu" style="padding-right: 64px; padding-left: 31px;">&nbsp;Email&nbsp;
                                </td>
                                <td>
                                    <asp:TextBox runat="server" ID="txtEmail" CssClass="css_ma fixCss" Width="307px" MaxLength="256" TabIndex="15"></asp:TextBox>
                                    <br />
                                    <asp:RegularExpressionValidator ID="revtxtEmail" SetFocusOnError="True" runat="server" ErrorMessage="Email không hợp lệ" ControlToValidate="txtEmail" Display="Dynamic" ForeColor="Red" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ValidationGroup="btok"></asp:RegularExpressionValidator>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td class="css_gchu">Ngày tiếp nhận <span class="emphas">*</span>
                    </td>
                    <td align="left">
                        <table cellpadding="0" cellspacing="0">
                            <tr>
                                <td>
                                    <asp:TextBox runat="server" ID="txtReceivingDate" CssClass="css_ma" Width="100px" TabIndex="16" />
                                    <asp:Image runat="server" ID="imgDate1" ImageUrl="~/Images/1370522190_plan.png" Width="25"
                                        Height="25" ImageAlign="AbsMiddle" />
                                    <asp:CalendarExtender ID="CalendarExtender1" runat="server" Format="dd/MM/yyyy" TargetControlID="txtReceivingDate"
                                        PopupButtonID="imgDate1" />
                                    <asp:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="txtReceivingDate" MaskType="Date" Mask="99/99/9999"/>
                                </td>
                                <td class="css_gchu">&nbsp;Ngày hẹn trả<span class="emphas">*</span>&nbsp;
                                </td>
                                <td>
                                    <asp:TextBox runat="server" ID="txtAppointmentDate" CssClass="css_ma" Width="307px" TabIndex="17"></asp:TextBox>
                                    <asp:Image runat="server" ID="imgDate2" ImageUrl="~/Images/1370522190_plan.png" Width="25"
                                        Height="25" ImageAlign="AbsMiddle" />
                                    <asp:CalendarExtender ID="CalendarExtender2" runat="server" Format="dd/MM/yyyy" TargetControlID="txtAppointmentDate"
                                        PopupButtonID="imgDate2" />
                                    <asp:MaskedEditExtender ID="MaskedEditExtender2" runat="server" TargetControlID="txtAppointmentDate" MaskType="Date" Mask="99/99/9999"/>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <asp:RequiredFieldValidator ID="rftxtReceivingDate" runat="server" Display="Dynamic"
                                        ValidationGroup="btok" SetFocusOnError="True" ErrorMessage="Ngày tiếp nhận không để trống"
                                        ControlToValidate="txtReceivingDate" ForeColor="Red"></asp:RequiredFieldValidator>
                                    <asp:RegularExpressionValidator ID="retxtReceivingDate" runat="server" ForeColor="Red"
                                        ErrorMessage="Ngày tiếp nhận không hợp lệ." ControlToValidate="txtReceivingDate"
                                        SetFocusOnError="True" Display="Dynamic" ValidationExpression="(^((((0[1-9])|([1-2][0-9])|(3[0-1]))|([1-9]))\x2F(((0[1-9])|(1[0-2]))|([1-9]))\x2F(([0-9]{2})|(((19)|([2]([0]{1})))([0-9]{2}))))$)"
                                        ValidationGroup="btok"></asp:RegularExpressionValidator>
                                </td>
                                <td>
                                    <asp:RequiredFieldValidator ID="rftxtAppointmentDate" runat="server" Display="Dynamic"
                                        ValidationGroup="btok" SetFocusOnError="True" ForeColor="Red" ErrorMessage="Ngày hẹn trả không để trống"
                                        ControlToValidate="txtAppointmentDate"></asp:RequiredFieldValidator>
                                    <asp:RegularExpressionValidator ID="retxtAppointmentDate" runat="server" ForeColor="Red"
                                        SetFocusOnError="True" ErrorMessage="Ngày hẹn trả không hợp lệ." ControlToValidate="txtAppointmentDate"
                                        Display="Dynamic" ValidationExpression="(^((((0[1-9])|([1-2][0-9])|(3[0-1]))|([1-9]))\x2F(((0[1-9])|(1[0-2]))|([1-9]))\x2F(([0-9]{2})|(((19)|([2]([0]{1})))([0-9]{2}))))$)"
                                        ValidationGroup="btok"></asp:RegularExpressionValidator>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td class="css_gchu">Trạng thái cấp
                    </td>
                    <td>
                        <asp:DropDownList runat="server" ID="ddlLevel" CssClass="css_drop" Width="220px" TabIndex="18">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="css_gchu">Đối tượng thực hiện <span class="emphas">*</span>
                    </td>
                    <td>
                        <asp:DropDownList runat="server" ID="ddlObject" CssClass="css_drop" Width="220px" TabIndex="19">
                            <Items>
                                <asp:ListItem Text="---Chọn đối tượng nộp hồ sơ---" Value="0"></asp:ListItem>
                                <asp:ListItem Text="Cá nhân" Value="1" Selected="True"></asp:ListItem>
                                <asp:ListItem Text="Tổ chức" Value="2"></asp:ListItem>
                            </Items>
                        </asp:DropDownList>
                        <br />
                        <asp:RequiredFieldValidator ID="rfvddlObject" runat="server" ValidationGroup="btok" ForeColor="Red"
                            ControlToValidate="ddlObject" InitialValue="0" SetFocusOnError="True"
                            ErrorMessage="Chọn đối tượng nộp hồ sơ" Display="Dynamic" />
                    </td>
                </tr>
                <tr>
                    <td class="css_gchu">Tên tổ chức/ Cá nhân <span class="emphas">*</span>
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txtOrgan" CssClass="css_ma" Width="550px" MaxLength="256" TabIndex="20"></asp:TextBox>
                        <!-- Task VONE_Maintain_18 add begin by longlc --> 
                        <br/>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Nhập tên tổ chức / cá nhân."
                            ControlToValidate="txtOrgan" Display="Dynamic" ForeColor="Red" ValidationGroup="btok"></asp:RequiredFieldValidator>
                        <!-- Task VONE_Maintain_18 add end by longlc -->     
                    </td>
                </tr>
                <tr>
                    <td class="css_gchu">Địa chỉ
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txtAddress" CssClass="css_ma" Width="550px" MaxLength="256" TabIndex="21"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="css_gchu">Điện thoại
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txtPhone" CssClass="css_ma" Width="100px" TabIndex="22"></asp:TextBox>
                        <br />
                        <asp:RegularExpressionValidator ID="retxtPhone" runat="server" ForeColor="Red" ErrorMessage="Số Phone không hợp lệ."
                            ControlToValidate="txtPhone" Display="Dynamic" ValidationExpression="^(0\d{9,10})$" SetFocusOnError="True"
                            ValidationGroup="btok"></asp:RegularExpressionValidator>
                    </td>
                </tr>
                <!-- Task VONE_Maintain_18 delete begin by longlc --> 
                <%--<tr>
                    <td class="css_gchu">Vị trí lưu trữ <span class="emphas">*</span>
                    </td>
                    <td>
                        <uc1:ASDropDownTreeView ID="ddlStorageLocation" CssClassDropdownBox="css_drop" runat="server"
                            DataTableRootNodeValue="0" EnableRoot="false" EnableNodeSelection="true" EnableDragDrop="false"
                            EnableTreeLines="true" EnableParentNodeSelection="True" EnableDebugMode="false"
                            EnableRequiredValidator="True" InitialDropdownText="---Chọn vị trí lưu trữ---"
                            RequiredValidatorText="*" RequiredValidatorDisplay="Dynamic" EnableContextMenu="False"
                            EnableNodeIcon="False" BasePath="~/Scripts/Javascript/astreeview" Width="300"
                            EnableCloseOnOutsideClick="true" EnableCheckbox="False" RequiredValidatorValidationGroup="btok"
                            EnableCloseOnNodeSelection="true" DropdownIconDown="~/Scripts/Javascript/asdropdowntreeview/images/ImgDropDown.png"
                            DropdownIconUp="~/Scripts/Javascript/asdropdowntreeview/images/ImgDropDown.png" TabIndex="21" />
                    </td>
                </tr>--%>
                <!-- Task VONE_Maintain_18 delete end by longlc --> 
                <%--<tr>
                    <td class="css_gchu">Ngày hẹn giải quyết <span class="emphas">*</span>
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txtSettlementDate" CssClass="css_ma" Width="100px" TabIndex="22"></asp:TextBox>
                        <asp:Image runat="server" ID="imgDate3" ImageUrl="~/Images/1370522190_plan.png" Width="25"
                            Height="25" ImageAlign="AbsMiddle" />
                        <asp:RequiredFieldValidator ID="rfvtxtSettlementDate" runat="server" Display="Dynamic"
                            ValidationGroup="btok" SetFocusOnError="True" ErrorMessage="Ngày hẹn giải quyết không để trống"
                            ControlToValidate="txtSettlementDate" ForeColor="Red"></asp:RequiredFieldValidator>
                        <asp:CalendarExtender ID="CalendarExtender3" runat="server" Format="dd/MM/yyyy" TargetControlID="txtSettlementDate"
                            PopupButtonID="imgDate3" />
                        <asp:MaskedEditExtender ID="MaskedEditExtender3" runat="server" TargetControlID="txtSettlementDate" MaskType="Date" Mask="99/99/9999"/>
                        <asp:RegularExpressionValidator ID="retxtSettlementDate" runat="server" ForeColor="Red"
                            SetFocusOnError="True" ErrorMessage="Hẹn ngày giải quyết không hợp lệ." ControlToValidate="txtSettlementDate"
                            Display="Dynamic" ValidationExpression="(^((((0[1-9])|([1-2][0-9])|(3[0-1]))|([1-9]))\x2F(((0[1-9])|(1[0-2]))|([1-9]))\x2F(([0-9]{2})|(((19)|([2]([0]{1})))([0-9]{2}))))$)"
                            ValidationGroup="btok"></asp:RegularExpressionValidator>
                    </td>
                </tr>--%>
                <tr>
                    <td class="css_gchu">Ghi chú
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txtNotes" TextMode="MultiLine" Width="545px" CssClass="css_nd"
                            Rows="3" TabIndex="23" MaxLength="500"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="css_gchu">Đơn đính kèm
                    </td>
                    <td>
                        <asp:LinkButton runat="server" ID="lblDon" OnClick="LbtXemdonClick" ForeColor="Blue" TabIndex="24" />&nbsp;
                        <asp:ImageButton ID="imgDelete" runat="server" AlternateText="Delete" ToolTip="Delete Item"
                            ImageUrl="~/Images/imgDelete.gif" Visible="False"
                            OnClientClick=" return confirm('Bạn có chắc chắn muốn xóa?'); " OnClick="ImgDeleteClick" />
                    </td>
                </tr>
                <tr>
                    <td class="css_gchu" valign="top">File nội dung đơn
                    </td>
                    <td>
                        <asp:FileUpload ID="fileAttachments" runat="server" CssClass="css_ma" Width="545px" TabIndex="25" />
                        <br />
                        <%--<asp:RequiredFieldValidator ID="rfvfileAttachments" runat="server" ControlToValidate="fileAttachments" ForeColor="Red"
                            ErrorMessage="File đính kèm không để trống" Display="Dynamic" InitialValue="" ValidationGroup="btok"></asp:RequiredFieldValidator>--%>
                        <asp:RegularExpressionValidator ID="refileAttachments" runat="server" ForeColor="Red"
                            SetFocusOnError="True" ErrorMessage="File upload không hợp lệ" ControlToValidate="fileAttachments"
                            Display="Dynamic" ValidationExpression="^.*\.(doc|docx|xls|xlsx|pdf|jpg|gif|tif|tiff|zip|rar)$"
                            ValidationGroup="btok"></asp:RegularExpressionValidator>
                        <asp:CustomValidator ID="cvfileAttachments1" runat="server" ForeColor="Red" ValidationGroup="btok"
                            Display="Dynamic" ControlToValidate="fileAttachments" SetFocusOnError="True"
                            ErrorMessage="Dung lượng file đính kèm không được > 10Mb và = 0kb" OnServerValidate="CvfileAttachmentsServerValidate"
                            ClientValidationFunction="checkfilesize"></asp:CustomValidator>
                        <asp:CustomValidator ID="cvfileAttachments2" runat="server" ForeColor="Red" ValidationGroup="btok"
                            Display="Dynamic" ControlToValidate="fileAttachments" SetFocusOnError="True"
                            ErrorMessage="Tên file + đường dẫn quá dài - nhỏ hơn 100 ký tự" OnServerValidate="CvfileAttachmentsServerValidate2"></asp:CustomValidator>
                        <br />
                        (.doc, .docx, .xls, .xlsx, .pdf, .jpg, .gif, .tif, .tiff, .zip, .rar) - dung lượng < 10mb.</td>
                </tr>
                <tr>
                    <td class="css_gchu" valign="top">Hồ sơ gốc
                    </td>
                    <td>
                        <asp:Repeater runat="server" ID="rptHoSoGoc">
                            <ItemTemplate>
                                <asp:LinkButton runat="server" ID="lbtnHoSo" ForeColor="Blue"
                                    OnCommand="lbtnHoSo_Command" CommandName="HoSoGoc" 
                                    CommandArgument='<%# Container.DataItem %>'
                                    Text='<%# Container.DataItem %>'></asp:LinkButton>
                                <br/>
                            </ItemTemplate>
                        </asp:Repeater>
                    </td>
                </tr>
                <tr>
                    <td class="css_gchu" valign="top">File hồ sơ gốc
                    </td>
                    <td>
                        <asp:FileUpload ID="fileAttachmentsOriginal" runat="server" CssClass="css_ma" Width="545px" TabIndex="27" />
                        <br />
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ForeColor="Red"
                            SetFocusOnError="True" ErrorMessage="File upload không hợp lệ" ControlToValidate="fileAttachmentsOriginal"
                            Display="Dynamic" ValidationExpression="^.*\.(doc|docx|xls|xlsx|pdf|jpg|gif|tif|tiff|zip|rar)$"
                            ValidationGroup="btok"></asp:RegularExpressionValidator>
                        <asp:CustomValidator ID="CustomValidator1" runat="server" ForeColor="Red" ValidationGroup="btok"
                            Display="Dynamic" ControlToValidate="fileAttachmentsOriginal" SetFocusOnError="True"
                            ErrorMessage="Dung lượng file đính kèm không được > 10Mb và = 0kb" OnServerValidate="CvfileAttachmentsOriginalServerValidate"
                            ClientValidationFunction="checkfilesize"></asp:CustomValidator>
                        <asp:CustomValidator ID="CustomValidator2" runat="server" ForeColor="Red" ValidationGroup="btok"
                            Display="Dynamic" ControlToValidate="fileAttachmentsOriginal" SetFocusOnError="True"
                            ErrorMessage="Tên file + đường dẫn quá dài - nhỏ hơn 100 ký tự" OnServerValidate="CvfileAttachmentsOriginalServerValidate2"></asp:CustomValidator>
                        <br />
                        (.doc, .docx, .xls, .xlsx, .pdf, .jpg, .gif, .tif, .tiff, .zip, .rar) - dung lượng < 10mb.</td>
                </tr>
                <tr>
                    <td colspan="2" class="C_out">
                        <table cellpadding="0" cellspacing="1" width="100%" class="C_in">
                            <tr>
                                <td colspan="2">
                                    <em class="lbl"><strong>Kết quả thực hiện thủ tục hành chính: </strong></em>
                                    <asp:Label runat="server" ID="lblResultsImplementation" Text=""></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" style="height: 30px !important;">
                        <asp:Label runat="server" ID="lblMessage" ForeColor="Red" Font-Bold="True" Text=""></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="left">
                        <table cellpadding="0" cellspacing="1">
                            <tr>
                                <td>
                                    <asp:Button runat="server" ID="btnGhilai" Text="Tiếp nhận" CssClass="css_button default" ValidationGroup="btok"
                                        OnClick="BtnGhilaiClick" TabIndex="28" Height="26px" />
                                </td>
                                <td>
                                    <asp:Button runat="server" ID="btnInPhieuTiepNhan" Text="In Phiếu Biên Nhận" CssClass="css_button"
                                        OnClick="BtnInPhieuTiepNhan" TabIndex="29" Visible="False" />
                                </td>
                                <td>
                                    <asp:Button runat="server" ID="btnInPhieuBanGiao" Text="In Phiếu Bàn Giao" CssClass="css_button"
                                        OnClick="BtnInPhieuBanGiao" TabIndex="30" Visible="False" />
                                </td>
                                <td>
                                    <asp:Button runat="server" ID="btnChuyenXuLy" Text="Chuyển Xử Lý" CssClass="css_button"
                                        OnClick="BtnChuyenXuLyClick" TabIndex="31" Enabled="True" />
                                </td>
                                <td>
                                    <asp:Button runat="server" ID="btnHuy" Text="Hủy" CssClass="css_button" OnClick="BtnHuyClick" TabIndex="32" />
                                </td>
                                <td>
                                    <asp:Button runat="server" ID="btnQuaylai" Text="Quay lại" CssClass="css_button"
                                        OnClick="BtnQuaylaiClick" TabIndex="33" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
<script src='<%= this.ResolveUrl("~/Scripts/ModalPopupWindow.js") %>' type="text/javascript"></script>
<script type="text/javascript">
    function checkfilesize(source, arguments) {
        arguments.IsValid = false; 
 
        var axo = new ActiveXObject("Scripting.FileSystemObject");
        thefile = axo.getFile(arguments.Value);
        var size = thefile.size;
        if (size >= 10 * 1024 * 1024) {
            arguments.IsValid = false;
            $('input[id$=btnGhilai]').attr("disabled", "disabled");
            $('input[id$=btnHuy]').attr("disabled", "disabled");
        }
        else if (size == 0) {
            arguments.IsValid = false;
            $('input[id$=btnGhilai]').attr("disabled", "disabled");
            $('input[id$=btnHuy]').attr("disabled", "disabled");
        }
        else {
            arguments.IsValid = true;
            $('input[id$=btnGhilai]').removeAttr("disabled");
            $('input[id$=btnHuy]').removeAttr("disabled");
        }
 

    }

    document.documentElement.onclick = function () {
        $find("<%= CalendarExtender1.ClientID %>").hide();
        $find("<%= CalendarExtender2.ClientID %>").hide();
    }

    var modalHoSo = new CreateModalPopUpObject();
    modalHoSo.SetLoadingImagePath('<%= this.ResolveUrl("~/Images/loading.gif")%>');
    modalHoSo.SetCloseButtonImagePath('<%= this.ResolveUrl("~/Images/remove.gif")%>');

    function ShowNewPage(page, id, title) {
        var callbackFunctionArray = new Array(OkScript);
        if (page == 1) {
            modalHoSo.ShowURL('TaiLieuHoSo.aspx?ProfileId=' + id, 500, 1000, title, closeScript, callbackFunctionArray);
        }
        if (page == 2) {
            modalHoSo.ShowURL('YKien.aspx?ProfileId=' + id, 500, 1000, title, closeScript, callbackFunctionArray);
        }
        if (page == 3) {
            modalHoSo.ShowURL('CongViec.aspx?ProfileId=' + id, 500, 1000, title, closeScript, callbackFunctionArray);
        }
        if (page == 4) {
            modalHoSo.ShowURL('QuaTrinh.aspx?ProfileId=' + id, 500, 1000, title, closeScript, callbackFunctionArray);
        }
        if (page == 5) {
            modalHoSo.ShowURL('ChuyenXuLy.aspx?ProfileId=' + id, 500, 1000, title, closeScript, callbackFunctionArray);
        }
        if (page == 6) {
            modalHoSo.ShowURL('TienDo.aspx?ProfileId=' + id, 500, 1000, title, closeScript, callbackFunctionArray);
        }
        if (page == 7) {
            modalHoSo.ShowURL('SelectProfileType.aspx?code=' + id, 550, 700, title, closeScript, callbackFunctionArray);
        }
    }

    String.prototype.insert = function (index, string) {
        if (index > 0)
            return this.substring(0, index) + string + this.substring(index, this.length);
        else
            return string + this;
    };

    function closeScript() {
        //if (window.location.toString().indexOf("ProfileId") == -1) {
            //window.location = window.location + "?ProfileId=" + <%=this.ProfileId%> ;
        //} else {
            //window.location = window.location;
        //}
        
        if (window.location.toString().indexOf("ProfileId") == -1) {
            window.location = window.location + "?ProfileId=" + <%=this.ProfileId%>
            } else {
            window.location = window.location;
            //window.location.pathname = "/Modules/HoSo/GiaiquyetthutuchanhchinhEdit.aspx?ProfileId=" + <%=this.ProfileId%>;
        }
    }

    function OkScript(msg) {
        modalHoSo.HideModalPopUp();
        if (msg == 1) {
            window.location = window.location;
        }
    }

    var flag = true;

    $(function () {
        //        $('input[id$=btnGhilai]').click(function (e) {
        //            e.preventDefault();
        //            var callbackFunctionArray = new Array(OkScript);
        //            modalHoSo.ShowURL('UserDepartmentEdit.aspx', 320, 600, 'Phòng ban chức vụ người dùng', null, callbackFunctionArray);
        //        });

        $('input[id$=fileAttachmentsOriginal]').MultiFile({
            STRING: { remove: 'Xóa',
                selected:'Vừa chọn file: $file',
                denied:'Định dạng file không hợp lệ $ext!',
                duplicate:'Đã tồn tại file:\n$file!' 
            },
            max: 5, 
            accept: 'doc|docx|xls|xlsx|pdf|jpg|gif|tif|tiff|zip|rar'
        });

        $('input[id$=fileAttachments]').bind('change', function() {
            if (this.files[0].size >= 10 * 1024 * 1024) {
                alert("Dung lượng file đính kèm không được > 10Mb");
                $('input[id$=btnGhilai]').attr("disabled", "disabled");
                $('input[id$=btnHuy]').attr("disabled", "disabled");
                flag = false;
            } else if (this.files[0].size == 0) {
                alert("Dung lượng file đính kèm không được = 0kb");
                $('input[id$=btnGhilai]').attr("disabled", "disabled");
                $('input[id$=btnHuy]').attr("disabled", "disabled");
                flag = false;
            }
            else {
                $('input[id$=btnGhilai]').removeAttr("disabled");
                $('input[id$=btnHuy]').removeAttr("disabled");
            }
        });

        $('a[id$=lbtThongtinchung]').click(function(e) {
            e.preventDefault();
        });
        
        $('input[ID$=txtProfileTypeCode]').keypress(function (e) {
            var code = (e.keyCode ? e.keyCode : e.which);
            if (code == 13 && flag) {
                $('#<%= btnProfileTypeSelect.ClientID%>').click();
            }
         });

        $('input[type=text] select').keypress(function (e) {
            var code = (e.keyCode ? e.keyCode : e.which);
            if (code == 13 && flag) {
                $('#<%= btnGhilai.ClientID %>').click();
            }
        });

        $('select[id$=ddlProfileType]').focus();

        $('.Example_F').draggable();

        $(document).keypress(function (e) {
            var code = (e.keyCode ? e.keyCode : e.which);
            if (code == 13 && flag) {
                $('*:focus').click();
            }
            if (code == 27) {
                modalHoSo.HideModalPopUp();
            }
        });

        ////$('input[id$=txtReceivingDate]').mask('99/99/9999');
        ////$('input[id$=txtAppointmentDate]').mask('99/99/9999');
        ////$('input[id$=txtSettlementDate]').mask('99/99/9999');

        $(".collapsibleContainer").collapsiblePanel();
        
        $(".collapsibleContainerContent").css('display', 'none');
        
        //$('input[id$=btnQuaylai]').click(function(e) {
        //    e.preventDefault();
        //    history.back();
        //    //window.location = window.location;
        //});
        
    });
</script>
